<?php

declare(strict_types=1);

namespace App\Http\Dto\Api\User;

use Hesb\LaravelPlus\Annotation\ApiModel;
use Hesb\LaravelPlus\Annotation\ApiModelProperty;
use Hesb\LaravelPlus\Annotation\Rule\Accepted;
use Hesb\LaravelPlus\Annotation\Rule\Between;
use Hesb\LaravelPlus\Annotation\Rule\DateFormat;
use Hesb\LaravelPlus\Annotation\Rule\Email;
use Hesb\LaravelPlus\Annotation\Rule\In;
use Hesb\LaravelPlus\Annotation\Rule\Min;
use Hesb\LaravelPlus\Annotation\Rule\NotIn;
use Hesb\LaravelPlus\Annotation\Rule\Regex;
use Hesb\LaravelPlus\Annotation\Rule\Required;
use Hesb\LaravelPlus\Annotation\Rule\RequiredIf;
use Hesb\LaravelPlus\Annotation\Rule\Same;

#[ApiModel('用户管理')]
class UserDto
{
    #[ApiModelProperty(value:'昵称',required: true)]
    #[Required]
//    #[RequiredIf(['user.sex'=>'1'])]
//    #[Same("tc")]
    public string $nick_name;

    #[ApiModelProperty('手机号')]
    #[Regex(value:"/^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/")]
    public String $mobile;

    #[ApiModelProperty('邮箱')]
//    #[Email]
    public string $email;

    #[ApiModelProperty('年龄')]
//    #[Between(min:18,max:60)]
//    #[Min(18)]
    #[Required]
    public string $age;

    #[ApiModelProperty('性别: 1 男, 2 女')]
    #[In(['1','2'])]
//    #[NotIn(['1','2'])]
    public string $sex;
}
